package com.qf.springcloud.fallback;

import com.netflix.discovery.converters.Auto;
import com.qf.springcloud.client.AirSearchClient;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zjw
 * @description
 * @date 2021/11/11 9:57
 */
@Component
public class AirSearchClientFallbackFactory implements FallbackFactory<AirSearchClient> {

    @Autowired
    private AirSearchClientFallback airSearchClientFallback;

    @Override
    public AirSearchClient create(Throwable cause) {
        // 输出异常信息
        System.out.println(cause.getMessage());
        cause.printStackTrace();
        System.out.println(cause.getMessage());
        return airSearchClientFallback;
    }
}
